<div id="StartLoad" style="display: block; left:650px;" class="datagrid-mask-msg">正在处理，请稍待。。。</div>
<table class="gMain" cellpadding="0" cellspacing="0">
	<tr>
		<td colspan="3" class="top">
		    <div class="gLogo"><img src="<?=$img?>/logo.gif"/></div>
			<div class="tLnk">
				<a href="javascript:void(0);" id="CloseAll" title="关闭">关闭菜单</a>&nbsp;&nbsp;|&nbsp;&nbsp;
				<a href="/main/exit" title="退出">退出</a>
			</div>
	        <div class="tooltab">
		        <table class="mailTitle">
		  			<tr>
					    <td width="183">&nbsp;</td>
					    <td height="28" width="3000" id="divTab">
							<div id="tabItem_Wlcome" class="Selected">
								<ul>
									<li id="divTab01"><a target="iframe_right" href="/welcome"><br></br></a></li>
									<li id="divTab02"><a class="gTabfont" target="iframe_right" href="/welcome">首页&nbsp;</a></li>
									<li id="divTab04"><a target="iframe_right" href="/welcome"><br></br></a></li>
								</ul>
							</div>
		        		</td>
		    			<td width="100">&nbsp;</td>
		  			</tr>
				</table>
			</div>
		</td>
	</tr>
	<tr>
		<td class="left">
			<div class="menuTopbutton">
				<ul>
					<li class="menuTopbuttonbg">客户管理系统主菜单</li>
				</ul>
			</div>
			<div id="Folders" style="overflow-x:hidden;overflow-y:scroll;">
				<?php foreach ($menu_list[0] as $key=>$value):?>
					<ul>
						<li class="FoldersList <?=($key==0)?"show":"";?>" <?="show='#Items".$value['id']."'";?>>
							<span><?=$value['name']?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
						</li>
						<li class="ulFloat">
							<div id="<?="Items".$value['id'];?>" class="ulSysFolders">
								<ul>
								<?php foreach ($menu_list[$value['id']] as $row):?>
									<li class="sysFolderClass">
										<a id="targets" target="iframe_right" code="Items<?=$row['id']?>" href="<?=$row['path']?>">
											<span><?=$row['name']?></span>
										</a>
									</li>
								<?php endforeach;?>
								</ul>
							</div>
						</li>
					</ul>
					<?php $show_bool=false;?>
				<?php endforeach;?>
			</div>
		</td>
		<td class="line"></td>
		<td  style="vertical-align:top;">
			<!-- 
	        <div id="mailinfo">
				<div class="fontStyle02">您好！欢迎使用网络资料库。</div>
				<div class="linkStyle01">网络资料库主要是为了满足，资料信息的保存、整理及分享的功能！</div>
			</div>
			 -->
			<iframe id="iframe_right" name="iframe_right" frameborder=0 scrolling="auto"></iframe>
			<script type="text/javascript">
				//窗口调整
				var iheight = $(window).height()-92;
				var iwidth  = $(window).width()-191;
				$('#iframe_right').height(iheight);
				$('#iframe_right').width(iwidth);
				$('div#Folders').height(iheight-35);
				iframe_right.document.getElementsByTagName("body").height = iheight;
			</script>
		</td>
	</tr>
	<tr>
		<td colspan="3">
			<div class="bottomdiv">
				<ul class="bottomlu">
					<li class="bottomlileft">
						您好【<?=$user['cname'];?>】,欢迎使用世纪立信CRM
					</li>
					<li class="bottomliright">
						版权所有 © 2012 世纪立信CRM  All Rights Reserved 蜀ICP备0000号
					</li>
				</ul>
			</div>
		</td>
	</tr>
</table>

<!-- 提示消息框 -->
<div id="alertMsg" flg="false" class="dia skin_default" style="width:420px;height:150px;position:absolute;z-index:1001;bottom:-150px;right:3px;">
	<div class="divline" style="width:417px;height:138px;">
		<div unselectable="on">
			<table width="100%" cellspacing="0" cellpadding="0" border="0" class="layer01">
				<tbody>
					<tr>
						<td class="headb">业务提醒消息</td>
					</tr>
				</tbody>
			</table>
		</div>
		<div class="content" style="width:417px; height: 113px;">
			<div id="alert">
				<div><b>您好，您总共有<font id="count" color="red">10</font>条未处理的提醒消息！</b></div>
				<table width="100%" cellspacing="0" cellpadding="0" border="0">
					<tbody>
						<tr>
							<td class="msg"><a>1、业务提醒消息业务提醒消息业务提醒消息业务提醒消息业务提醒消息业务提醒消息</a></td>
							<td class="time">01/01 23:16</td>
						</tr>
						<tr>
							<td class="msg"><a>2、测试消息</a></td>
							<td class="time">01/01 23:16</td>
						</tr>
						<tr>
							<td class="msg"><a>3、测试消息</a></td>
							<td class="time">01/01 23:16</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
		<div id="alertClose" class="close_ico" style="display: block;"></div>
	</div>
</div>
<script type="text/javascript">
//定时读取消息
setInterval("alertMsg()",20000);

//消息处理函数
function alertMsg(){
	//判断消息窗口是否已经打开
	if($("#alertMsg").attr('flg') == "false"){

		//获取消息内容
		$.post('/common/bLogAlert',null,function(msg){
			if(msg.count > 0){
				var dataList = msg.data[0];
				$("#alert tbody").empty();
				$("#alert #count").text(msg.count);

				//写消息记录
				for(var i=0;i<dataList.length;i++){
					var htmlStr = "<tr>" +
						          "	<td class='msg'><a>" + (i+1) + "、" + dataList[i].content + "</a></td>" +
						          "	<td class='time'>" + dataList[i].created.substring(0,16) + "</td>"+
						          "</tr>";
					$("#alert tbody").append(htmlStr);
				}
				$("#alertMsg").attr('flg',"true");
				$("div#alertMsg").animate({bottom:"10px"},1000);
		   		return false;
		   	}else{
		   		return false;
		   	}
		},'json');
	}
}

//关闭提示
$("div#alertClose").click(function(){
	$("#alertMsg").attr('flg',"false");
	$("div#alertMsg").animate({bottom:"-150px"},1000);
});

$("a#CloseAll").click(function(){
	$('#divTab div').not('#divTab #tabItem_Wlcome').remove();
	iframe_right.location.href = "/welcome";
});
</script>